<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    <base href="<%=basePath%>">
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>账户设置</title>
    
    <jsp:include page="../common/common.jsp"></jsp:include>
    
    
  </head>
  
  <body class="client-body baseContent-active">
  	<jsp:include page="../common/client-head.jsp"></jsp:include>
	<script src="<%=request.getContextPath() %>/resources/js/system/index/jquery.md5.js"></script>
	<script src="<%=request.getContextPath() %>/resources/js/ajaxfileupload.js"></script>
	<script src="<%=request.getContextPath() %>/resources/js/My97DatePicker/WdatePicker.js"></script>
    
  	<div class="client-content">
  		<jsp:include page="../common/client-leftMenu-setting.jsp"></jsp:include>
  	
  		<div class="client-contentBox">
  			<div id="as-title" class="as-title clearfix">
  				<a id="" data-page="baseContent" class="a-black baseBtn" href="javascript:;">基本资料</a>
  				<a id="" data-page="approveContent" class="a-black approveBtn" href="javascript:;">认证资料</a>
  				<a id="" data-page="updatePassContent" class="a-black updatePassBtn" href="javascript:;">修改密码</a>
  			</div>
  		
  			<!-- 基本资料 -->
  			<form id="baseContent" class="form-horizontal as-formBox as-formBox2" style="display: block;">
			  <div class="form-group">
			    <label class="col-sm-3 control-label">手机</label>
			    <div class="col-sm-9">
			    	已绑定手机号：<span id="tel">${phone}</span>
			    	<input type="hidden" id="type" value="${type}">
			    	<input type="hidden" id="phone" value="${phone}">
			    	<a class="btn btn2 a-white as-formStyle" href="javascript:;" style="display: none">更换</a>
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <label class="col-sm-3 control-label">性别</label>
			    <div class="col-sm-9 as-formStyle2">
			    	  男<input type="radio" name="sex" value="男" checked="checked" />
			    	  女<input type="radio" name="sex" value="女" />
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <label class="col-sm-3 control-label">所在地</label>
			    <div class="col-sm-9 as-formStyle2">
			    	<select id="province" name="province" style="width:140px">
						<option>浙江省</option>
						<option>江苏省</option>
					</select>
			    	<select id="city" name="city" style="width:130px">
			    		<option value=''>---请选择---</option>
					</select>
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <div class="col-sm-offset-3 col-sm-9">
			      <button type="submit" id="save" class="btn btn2 a-white as-formStyle3">保存</button>
			    </div>
			  </div>
			  
			  <div id="error1" class="error-resgister">
					<span id="errorContent1"></span><!-- 错误提示 -->
			  </div>
			</form>
  		
  			<!-- 认证资料 -->
  			<div id="approveContent" class="form-horizontal as-formBox as-approveBox" style="display: none;">
	  			<div class="as-approveHead">
	  				<div id="firm" style="display: none;">企业认证</div>
  					<div id="personal" style="display: block;">个人认证</div>
	  			</div>
	  			
	  			<!-- 企业认证 -->
	  			<form id="firmData" class="as-firmData" style="display: none;">
					<div class="form-group">
					    <label class="col-xs-3 control-label">公司名称</label>
					    <div class="col-xs-9">
					     	 <input type="text" id="firmname" name="name" class="form-control" />
					    </div>
					 </div>
					  
					 <div class="form-group">
					    <label class="col-sm-3 control-label">公司地址</label>
					    <div class="col-sm-9">
					     	 <input type="text" id="firmaddr" name="site" class="form-control" />
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">联系人</label>
					    <div class="col-sm-9">
					     	 <input type="text" id="contacts" name="contacts" class="form-control" />
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">公司固话</label>
					    <div class="col-sm-9">
					     	 <input type="text" id="fixedtel" name="fixedtel" class="form-control" />
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">成立时间</label>
					    <div class="col-sm-9 as-formStyle2">
					    	<input id="establishmentDate" name="establishment" type="text" onClick="WdatePicker()"/>
					     	<!-- <select id="establishmentDate" name="establishmentDate">
								<option>2016</option>	
								<option>2015</option>
							</select> -->
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">公司规模</label>
					    <div class="col-sm-9 as-formStyle2">
					     	<select id="scale" name="scale">
								<option value="1">20人以下</option>	
								<option value="2">20-50人</option>
								<option value="3">50-100人</option>
								<option value="4">100-200人</option>
								<option value="5">200人以上</option>
							</select>
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">营业执照</label>
					    <div class="col-sm-9 as-formStyle2">
					     	 <input type="file" id="licenseFile" name="licenseFile"/>
					    </div>
					    <div class="col-sm-offset-3 col-sm-9 as-formStyle4">
					     	 <div>1、该信息只用于审核，身份信息将完全保密</div>
					     	 <div id="licensediv"></div>
					     	 <div class="error-resgister" id="upload_error4" style="display: none">格式为JPG、PNG、BMP、GIF，不超过5M</div>
					     	 <div><span>上传：</span><input type="button" value="确定上传" onclick="uploadFile('1','licenseFile','licensediv','upload_error4','${phone}')"/></div>
					    </div>
					 </div>
					  
					  <div class="form-group">
					    <div class="col-sm-offset-3 col-sm-4">
					      <button type="submit" class="btn btn-default as-formStyle3">取消</button>
					    </div>
					    <div class="col-sm-offset-1 col-sm-4">
					      <button type="submit" id="firmsubmit" class="btn btn2 a-white as-formStyle3">提交申请</button>
					    </div>
					  </div>
				  </form>
				  
			    <!-- 个人认证 -->
	  			<form id="personalData" class="as-firmData" style="display: block;">
					<div class="form-group">
					    <label class="col-xs-3 control-label">真实姓名</label>
					    <div class="col-xs-9">
					     	 <input type="text" id="name" name="name" class="form-control" />
					    </div>
					 </div>
					  
					 <div class="form-group">
					    <label class="col-sm-3 control-label">公司/个人工作室</label>
					    <div class="col-sm-9">
					     	 <input type="text" id="company" name="company" class="form-control" />
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">办公地址</label>
					    <div class="col-sm-9">
					     	 <input type="text" id="studioaddr" name="site" class="form-control" />
					    </div>
					 </div>
					 
					 <div class="form-group">
					    <label class="col-sm-3 control-label">名片</label>
					    <div class="col-sm-9 as-formStyle2">
					     	 <input type="file" id="idFile" name="idFile"/>
					    </div>
					    <div class="col-sm-offset-3 col-sm-9 as-formStyle4">
					     	 <div>1、该信息只用于审核，身份信息将完全保密</div>
					     	 <div id="iddiv"></div>
					     	 <div class="error-resgister" id="upload_error1" style="display: none">格式为JPG、PNG、BMP、GIF，不超过5M</div>
					     	 <div><span>上传：</span><input type="button" value="确定上传" onclick="uploadFile('1','idFile','iddiv','upload_error1','${phone}')"/></div>
					    </div>
					 </div>
					 
					  <div class="form-group">
						    <label class="col-sm-3 control-label">身份证正面</label>
						    <div class="col-sm-9 as-formStyle2">
						     	 <input type="file" id="idfFile" name="idfFile"/>
						    </div>
						    <div class="col-sm-offset-3 col-sm-9 as-formStyle4">
						     	 <div>1、请上传二代彩色身份证</div>
						     	 <div>2、该信息只用于审核，身份信息将完全保密</div>
						     	 <div id=idfdiv></div>
						     	 <div class="error-resgister" id="upload_error2" style="display: none">格式为JPG、PNG、BMP、GIF，不超过5M</div>
						     	 <div><span>上传：</span><input type="button" value="确定上传" onclick="uploadFile('1','idfFile','idfdiv','upload_error2','${phone}')"/></div>
						    </div>
					  </div>
					  
					   <div class="form-group">
						    <label class="col-sm-3 control-label">身份证反面</label>
						    <div class="col-sm-9 as-formStyle2">
						     	 <input type="file" id="idoFile" name="idoFile"/>
						    </div>
						    <div class="col-sm-offset-3 col-sm-9 as-formStyle4">
						     	 <div>1、请上传二代彩色身份证</div>
						     	 <div>2、该信息只用于审核，身份信息将完全保密</div>
						     	 <div id=idodiv></div>
						     	 <div class="error-resgister" id="upload_error3" style="display: none">格式为JPG、PNG、BMP、GIF，不超过5M</div>
						     	 <div><span>上传：</span><input type="button" value="确定上传" onclick="uploadFile('1','idoFile','idodiv','upload_error3','${phone}')"/></div>
						    </div>
						 </div>
						 
						 <div id="as-works"  class="as-works">
						    <div class="form-group">
							    <label class="col-sm-3 control-label">个人作品</label>
							    <div class="col-sm-9 as-formStyle2">
							     	 <input type="text" id="works1" name="works1" class="form-control" />
							    </div>
						    </div>
						    <div class="form-group">
							    <label class="col-sm-3 control-label">个人作品</label>
							    <div class="col-sm-9 as-formStyle2">
							     	 <input type="text" id="works2" name="works2" class="form-control" />
							    </div>
						    </div>
						    <div class="form-group">
							    <label class="col-sm-3 control-label">个人作品</label>
							    <div class="col-sm-9 as-formStyle2">
							     	 <input type="text" id="works3" name="works3" class="form-control" />
							    </div>
						    </div>
						</div>
					  
					  <div class="form-group">
					    <div class="col-sm-offset-3 col-sm-4">
					      <button type="submit" class="btn btn-default as-formStyle3">取消</button>
					    </div>
					    <div class="col-sm-offset-1 col-sm-4">
					      <button type="submit" id="personalsubmit" class="btn btn2 a-white as-formStyle3">提交申请</button>
					    </div>
					  </div>
					  
				  </form><!-- 个人认证 -->
				  
				  <div id="error2" class="error-resgister">
						<span id="errorContent2"></span><!-- 错误提示 -->
				  </div>
			</div>
			
			<!-- 修改密码 -->
  			<form id="updatePassContent" class="form-horizontal as-formBox as-formBox2" style="display: none;">
			  <div class="form-group">
			    <label class="col-sm-3 control-label">原始密码</label>
			    <div class="col-xs-9">
			    	 <input type="hidden" id="phoneno" value="${phone}">
			     	 <input type="password" id="oldpassword" name="oldpassword" class="form-control" />
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <label class="col-sm-3 control-label">新密码密码</label>
			    <div class="col-xs-9">
			     	 <input type="password" id="newpassword" name="newpassword" class="form-control" />
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <label class="col-sm-3 control-label">确认新密码</label>
			    <div class="col-xs-9">
			     	 <input type="password" id="checkpassword" name="checkpassword" class="form-control" />
			    </div>
			  </div>
			  
			  <div class="form-group">
			    <div class="col-sm-offset-3 col-sm-9">
			      <button type="submit" id="update" class="btn btn2 a-white as-formStyle3">修改</button>
			    </div>
			  </div>
			  
			  <div id="error3" class="error-resgister">
					<span id="errorContent3"></span><!-- 错误提示 -->
			  </div>
			</form>
			
  		</div><!-- as-content -->
  	</div><!-- client-content -->
	
  	<script type="text/javascript">
		$(document).ready(function(){
			$("#tel").html($("#tel").html().substring(0,3)+"****"+$("#tel").html().substring(7,11));
			if($("#type").val()==2){
	    		$("#personal").hide();
	    		$("#firm").show();
	    		$("#personalData").hide();
	    		$("#firmData").show();
	    	}
	    	//加载省份下拉框
	    	$.ajax({
	    		type:"POST",
	    		url : CONTEXT_PATH+'common/selectByComboCategory?category=Province',
	    		dataType : "json",  
	        	cache : false,  
	        	async : false,
	        	success:function(data){
	        		$("select[name='province']").empty();
	        		$("<option value=''>---请选择---</option>").appendTo("select[name='province']"); 
	        		for(var i = 0; i < data.length; i++){
	        			$("select[name='province']").append("<option value='"+data[i].value+"'>"+data[i].text+"</option>");
	        		}
	        	}
	    	});
	    	//省份改变时加载城市下拉框
	    	$("#province").change(function(){
	    		$.ajax({
	    			type:"POST",
	    			url : CONTEXT_PATH+'common/selectByComboCategory?category=City&idStr='+$("select[name='province']").val(),
	    			dataType : "json",  
	        		cache : false,  
	        		async : false,
	        		success:function(data){
	        			$("select[name='city']").empty();
	        			$("<option value=''>---请选择---</option>").appendTo("select[name='city']");
	        			for(var i = 0; i < data.length; i++){
	        			$("select[name='city']").append("<option value='"+data[i].value+"'>"+data[i].text+"</option>");
	        			}
	        		}
	    		});
	    	});
			contentToggle();//页面切换
			//addWork();//添加个人作品
			saveBaseInfo();//保存基本资料
			updatePwd();//修改密码
			submitConfirm();//认证资料提交申请(个人)
			firmSubmit();//认证资料提交申请(企业)
		});
		
		function contentToggle(){
			var tabItems = $("#as-title a");
	        tabItems.each(function() {
	            $(this).click(function(e) {
	                var page = $(this).data("page");
	                setCurrentPage(page);
	                
	                e.preventDefault();
	                return false;
	            });
	        });
		}
		
		var curPage = "baseContent";
		
		function setCurrentPage(newPage) {
			var $body = $(document.body);
	        if (newPage != curPage) {
	            $body.removeClass(curPage + '-active');
	            $body.addClass(newPage + '-active');
	            
				$("#" + curPage).hide();
	            $("#" + newPage).show();
	            
	            curPage = newPage;
	        }
	    }
	    
	    function addWork(){
	    	$("#as-workAdd").click(function(){
	  			var node=document.getElementById("as-workBar");
	    		
				var areaBar=node.cloneNode(true);
				areaBar = $(areaBar);
 					
 				var areaInput = areaBar.find("input");
 				areaInput.attr("name", "work");//请根据需要重新设置
 				
				$("#as-works").append(areaBar);
				
	    	});
	    }
	    
	    function saveBaseInfo(){
	    	$("#save").click(function(){
	    		var city=$("select[name='city']").val();
	    		
	    		if(city==""){
	    			$("#error1").css("display","block");
					$("#errorContent1").text("请选择城市！");
	    		}else{
	    			$("#errorContent1").text("");
	    			$.ajax({
	    				type:'post',
	    				url:CONTEXT_PATH+'front/setting/saveBaseInfo?phone='+$("#phone").val(),
	    				data: $("#baseContent").serialize(),
	    				async: false,
	    				success:function(data){
	    					if(data.flag){
	    						alert("保存成功！");
	    					}else{
	    						alert("保存失败！");
	    					}
	    				}
	    			});
	    		}
	    	});
	    }
	    
	    function updatePwd(){
	    	$("#update").click(function(){
	    		var oldpassword=$("#oldpassword").val();
	    		var newpassword=$("#newpassword").val();
	    		var checkpassword=$("#checkpassword").val();
	    		
	    		var pwd=/(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^.{6,16}$/;  //6~16位字符，至少包含数字.字母.符号中的2种
	    		
	    		if(oldpassword=="" || newpassword=="" || checkpassword==""){
	    			$("#error3").css("display","block");
					$("#errorContent3").text("您所填信息不完整！");
	    		}else if(!pwd.test(newpassword)){
	    			$("#error3").css("display","block");
					$("#errorContent3").text("密码必须是6-16位，至少包含数字.字母.符号中的2种！");
	    		}else if(newpassword==oldpassword){
	    			$("#error3").css("display","block");
					$("#errorContent3").text("新旧密码不能相同！");
	    		}else if(checkpassword!=newpassword){
	    			$("#error3").css("display","block");
					$("#errorContent3").text("您两次输入的密码不一致！");
	    		}else{
	    			$("#errorContent3").text("");
	    			upPwd();	
	    		}
	    	});
	    }
	    
	    function upPwd(){
	    	$.ajax({
	    		type:'post',
	    		url:CONTEXT_PATH+'front/setting/updatePwd',/* +$("#phone").val() */
	    		data: {"phone":$("#phoneno").val(),"opassword":$.md5($("#oldpassword").val()),"npassword":$.md5($("#newpassword").val())},
	    		async: false,
	    		success:function(data){
					if(data.flag){
						alert(data.message);
					}else{
						alert(data.message);
					}
	    		}
	    	});
	    }
	    
	    function submitConfirm(){
	    	$("#personalsubmit").click(function(){
	    		var name=$("#name").val();
	    		var company=$("#company").val();
	    		var addr=$("#studioaddr").val;
	    		var card=$("#iddiv").html();
	    		var idcardf=$("#idfdiv").html();
	    		var idcardo=$("#idodiv").html();
	    		var works1=$("#works1").val();
	    		var works2=$("#works2").val();
	    		var works3=$("#works3").val();
	    		
	    		var re=/^.{5,}$/;
	    		var re1=/^.{0,20}$/;
	    		
	    		if(name==""||company==""||addr==""||/^\s*?$/.test(card)||/^\s*?$/.test(idcardf)||/^\s*?$/.test(idcardo)){
	    			$("#error2").css("display","block");
					$("#errorContent2").text("您所填信息不完整！");
	    		}else if(!re.test(company)||!re.test(addr)){
	    			$("#error2").css("display","block");
					$("#errorContent2").text("公司/个人工作室及办公地址不少于5个汉字！");
					alert("公司/个人工作室及办公地址不少于5个汉字！");
	    		}else if(!re1.test(works1)||!re1.test(works2)||!re1.test(works3)){
	    			$("#error2").css("display","block");
					$("#errorContent2").text("个人作品每条不大于20个汉字！");
					alert("个人作品每条不大于20个汉字！");
	    		}else{
	    			$("#errorContent2").text("");
	    			$.ajax({
	    				type:'post',
	    				url:CONTEXT_PATH+'front/setting/personalConfirm?phone='+$("#phone").val(),
	    				data:$("#personalData").serialize(),
	    				async: false,
	    				success:function(data){
	    					if(data.flag){
	    						alert(data.message);
	    					}else{
	    						alert(data.message);
	    					}
	    				}
	    			});
	    		}
	    	});
	    }
	    
	    function firmSubmit(){
	    	$("#firmsubmit").click(function(){
	    		var name=$("#firmname").val();
	    		var site=$("#firmaddr").val();
	    		var contacts=$("#contacts").val();
	    		var fixedtel=$("#fixedtel").val();
	    		var establishmentDate=$("#establishmentDate").val();
	    		var scale=$("#scale").val();
	    		var licensediv=$("#licensediv").html();//营业执照
	    		
	    		
	    		var re=/^.{5,}$/;
	    		
	    		if(name==""||site==""||contacts==""||fixedtel==""||establishmentDate==""||scale==""||/^\s*?$/.test(licensediv)){
	    			$("#error2").css("display","block");
					$("#errorContent2").text("您所填信息不完整！");
					alert("公司名称及公司地址不少于5个汉字！");
	    		}else if(!re.test(name)||!re.test(site)){
	    			$("#error2").css("display","block");
					$("#errorContent2").text("公司名称及公司地址不少于5个汉字！");
					alert("公司名称及公司地址不少于5个汉字！");
	    		}else{
	    			$("#errorContent2").text("");
	    			$.ajax({
	    				type:'post',
	    				url:CONTEXT_PATH+'front/setting/firmConfirm?phone='+$("#phone").val(),
	    				data:$("#firmData").serialize(),
	    				async: false,
	    				success:function(data){
	    					if(data.flag){
	    						alert(data.message);
	    					}else{
	    						alert(data.message);
	    					}
	    				}
	    			});
	    		}
	    	});
	    }
	    
	    if('${userModel.license}'){
            fileid='${userModel.license}'.split(",");
            setimg(fileid,'iddiv');
        }else{
            fileid=[];
        }
	    
	    var uploadFile = function(type,id,div,error,phone) {
	    	if ($("#"+id).val() == "") {
				alert("请选择一个附件!");
				return;
			}else{
				var file=$("#"+id).val();
				var fileType = file.substring(file.lastIndexOf(".") + 1);
				if (!(fileType && /^(jpg|JPG|png|PNG|bmp|BMP|gif|GIF)$/.test(fileType))){
					$("#"+error).css('display', 'block');
					return;
				}else{
					$("#"+error).css('display', 'none');
					fileid=[];
					$.ajax({
						type:"post",
						async : false,
						url : FILESERVER_ID,
						dataType : "jsonp",
						jsonp : 'jsonpcallback',// 传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
						jsonpCallback : "feedBackState",// 自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名
						success : function(data) {
							fileid.push(data[0].id);
							
							$.ajaxFileUpload({
								url : FILESERVER_UPLOAD_PATH + '?origin=A3&id=' + data[0].id +'&note='+phone,
								secureuri : false,// 一般设置为false
								fileElementId : id,// 文件上传空间的id属性 <input
													// type="file" id="file"
													// name="file" />
								dataType : 'jsonp',// 返回值类型 一般设置为json
								jsonp : 'jsoncallback',
								success : function(data, status) // 服务器成功响应处理函数
								{
									setimg(fileid, div);
								},
								error : function(data, status, e)// 服务器响应失败处理函数
								{
									setimg(fileid, div);
								}
							});
						},
						error : function() {
						}
					});
				}
			}
			$("#"+id).val("");
	    };
	    
	    var setimg = function(id, element) {
	    	$("#" + element).html("");
	    	for ( var i = 0; i < id.length; i++) {
	    		if (id[i] != '') {
	    			if(element=='iddiv'){
	    				$("#" + element)
							.append(
									"<div class='images'>"
									+ "<div class='imgbox'><span>"
									+ "<img   onclick='javascript:parent.openImg(\""
									+ FILESERVER_PATH
									+ "\",\""
									+ id[i]
									+ "\")' src=\""
									+ FILESERVER_PATH
									+ "?id="
									+ id[i]
									+ "\"/><input type='hidden' id='license' name='license' value='"
									+ id[i]
									+ "'></span>"
									+ "</div>");
	    			}else if(element=='idfdiv'){
	    				$("#" + element)
							.append(
									"<div class='images'>"
									+ "<div class='imgbox'><span>"
									+ "<img   onclick='javascript:parent.openImg(\""
									+ FILESERVER_PATH
									+ "\",\""
									+ id[i]
									+ "\")' src=\""
									+ FILESERVER_PATH
									+ "?id="
									+ id[i]
									+ "\"/><input type='hidden' id='idfront' name='idfront' value='"
									+ id[i]
									+ "'></span>"
									+ "</div>");
	    			}else if(element=='idodiv'){
	    				$("#" + element)
							.append(
									"<div class='images'>"
									+ "<div class='imgbox'><span>"
									+ "<img   onclick='javascript:parent.openImg(\""
									+ FILESERVER_PATH
									+ "\",\""
									+ id[i]
									+ "\")' src=\""
									+ FILESERVER_PATH
									+ "?id="
									+ id[i]
									+ "\"/><input type='hidden' id='idopposite' name='idopposite' value='"
									+ id[i]
									+ "'></span>"
									+ "</div>");
	    			}else if(element=='licensediv'){
	    				$("#" + element)
							.append(
									"<div class='images'>"
									+ "<div class='imgbox'><span>"
									+ "<img   onclick='javascript:parent.openImg(\""
									+ FILESERVER_PATH
									+ "\",\""
									+ id[i]
									+ "\")' src=\""
									+ FILESERVER_PATH
									+ "?id="
									+ id[i]
									+ "\"/><input type='hidden' id='license' name='license' value='"
									+ id[i]
									+ "'></span>"
									+ "</div>");
	    			}	    			
	    		}
	    	}
	    };
	</script>
	
  </body>
</html>
